  function [mu,sd,mux,sdx,x]=u_ab2msd(a,b,t);
% =========================================  
% function [mx,sdx,x]=u_ab2msd(a,b,t);
% Given the bounds the A and B in the uniform distribution specified 
% find the implied MU and SD 
% Call with T=[] to avoid the simulation 
% =========================================
if b < a; error('b must be greater than a'); end; 
mu=0.5*(a+b); 
sd=sqrt( (b-a)*(b-a)/12 ); 
if nargin < 3 
    t=20000; 
else 
    if ~isempty(t); 
        x=unifrnd(a,b,t,1);
        mx=mean(x);
        sdx=std(x);
        disp(['Mean, ',num2str(mx),' & std ',num2str(sdx)]);
    end 
end 